package sisicotren.ui.simulator;

import java.awt.Graphics;
import java.awt.Toolkit;
import java.awt.Image;

public class ClientBasicImpl implements Client {

	public ClientBasicImpl() {
		location = new Point(0.00, 0.00);
	}
	
	public ClientBasicImpl(Point initialLocation) {
		location = new Point(initialLocation.getX(), initialLocation.getY());
	}
	
	public void draw(Graphics g) {
		if(clientImg == null)
			loadImg();
		g.drawImage(clientImg, 
				(int)location.getX(), 
				(int)location.getY(), 
				clientImg.getWidth(null), 
				clientImg.getHeight(null), 
				null);
	}
	
	private void loadImg() {
		clientImg = Toolkit.getDefaultToolkit().getImage(getClass().getResource("/img/silueta_small.png"));
	}
	
	public Point getPosition() {
		return this.location;
	}
	
	public void setPosition(Point p) {
		this.location = p;
	}
	
	private Point location;
	private Image clientImg;
}
